Parameters
- key
- The key of the element to remove.
Return Value
true if the element is successfully removed; otherwise, false. This method also returns false if key was not found in the original IDictionary.Library/Library.Test/TestLurchTable.cs
C# | Copy Code |
---|---|
LurchTableTest<int, string> test = new LurchTableTest<int, string>(); for (int i = 0; i < 10; i++) test.Add(i, i.ToString()); for (int i = 0; i < 10; i++) Assert.IsTrue(test.ContainsKey(i)); string cmp; for (int i = 0; i < 10; i++) Assert.IsTrue(test.TryGetValue(i, out cmp) && cmp == i.ToString()); for (int i = 0; i < 10; i++) Assert.IsTrue(test.Remove(i)); |
VB.NET | Copy Code |
---|---|
Dim test As New LurchTableTest(Of Integer, String)() Dim i As Integer = 0 While i < 10 test.Add(i, i.ToString()) System.Math.Max(System.Threading.Interlocked.Increment(i),i - 1) End While Dim i As Integer = 0 While i < 10 Assert.IsTrue(test.ContainsKey(i)) System.Math.Max(System.Threading.Interlocked.Increment(i),i - 1) End While Dim cmp As String Dim i As Integer = 0 While i < 10 Assert.IsTrue(test.TryGetValue(i, cmp) AndAlso cmp = i.ToString()) System.Math.Max(System.Threading.Interlocked.Increment(i),i - 1) End While Dim i As Integer = 0 While i < 10 Assert.IsTrue(test.Remove(i)) System.Math.Max(System.Threading.Interlocked.Increment(i),i - 1) End While |
Target Platforms: Windows XP, Windows Server 2003, Windows Vista, Windows Server 2008, Windows 7
Reference
LurchTable<TKey,TValue> ClassLurchTable<TKey,TValue> Members